package com.ruoyi.order.domain.request;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * 微信退款请求参数
 */
@Data
@ApiModel(description = "微信退款请求参数")
public class WeChatChargeBackRequest implements Serializable {

    @ApiModelProperty(value = "微信订单号", example = "微信订单号")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("transaction_id")
    private String transactionId;

    @ApiModelProperty(value = "商户订单号", example = "商户订单号")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("out_trade_no")
    private String outTradeNo;

    @ApiModelProperty(value = "商户退款单号", example = "商户退款单号")
    @JsonProperty("out_refund_no")
    private String outRefundNo;

    @ApiModelProperty(value = "退款原因", example = "退款原因")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String reason;

    @ApiModelProperty(value = "退款结果通知地址", example = "退款结果通知地址")
    @JsonProperty("notify_url")
    private String notifyUrl;

    @ApiModelProperty(value = "退款金额信息", example = "退款金额信息")
    private WeChatChargeBackAmountRequest amount;

    @Data
    @ApiModel(description = "退款金额信息")
    public static class WeChatChargeBackAmountRequest {

        @ApiModelProperty(value = "退款金额（单位：分）", example = "退款金额（单位：分）")
        private Integer refund;

        @ApiModelProperty(value = "订单总金额（单位：分）", example = "订单总金额（单位：分）")
        private Integer total;

        @ApiModelProperty(value = "货币类型，默认CNY", example = "CNY")
        private String currency = "CNY";
    }
}
